(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     14614,        479]
NotebookOptionsPosition[      9740,        335]
NotebookOutlinePosition[     13013,        420]
CellTagsIndexPosition[     12902,        414]
WindowTitle->CheckDB
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {Cell["FEYN CALC SYMBOL", "PacletNameCell"], Cell[TextData[Cell[BoxData[
     ActionMenuBox[
      FrameBox[
       InterpretationBox[Cell[TextData[{
         "URL",
         StyleBox[" \[FilledDownTriangle]", "AnchorBarArrow",
          StripOnInput->False]
        }]],
        TextCell[
         Row[{"URL", 
           Style[" \[FilledDownTriangle]", "AnchorBarArrow"]}]]],
       StripOnInput->False], {"\<\"FeynCalc/ref/CheckDB\"\>":>
      None, "\<\"Copy Wolfram Documentation Center URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell["FeynCalc/ref/CheckDB"]}, Visible -> False]]; 
       SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; Null], 
      Delimiter, "\<\"Copy web URL\"\>":>
      Module[{DocumentationSearch`Private`nb$}, 
       DocumentationSearch`Private`nb$ = NotebookPut[
          Notebook[{
            Cell[
             BoxData[
              MakeBoxes[
               Hyperlink[
               "http://reference.wolfram.com/language/FeynCalc/ref/CheckDB.\
html"], StandardForm]], "Input", TextClipboardType -> "PlainText"]}, Visible -> 
           False]]; SelectionMove[
        DocumentationSearch`Private`nb$, All, Notebook]; 
       FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
       NotebookClose[DocumentationSearch`Private`nb$]; 
       Null], "\<\"Go to web URL\"\>":>FrontEndExecute[{
        NotebookLocate[{
          URL[
           StringJoin[
            If[
             TrueQ[DocumentationBuild`Make`Private`wsmlinkQ$39370], 
             "http://reference.wolfram.com/system-modeler/", 
             "http://reference.wolfram.com/language/"], 
            "FeynCalc/ref/CheckDB", ".html"]], None}]}]},
      Appearance->None,
      MenuAppearance->Automatic,
      MenuStyle->"URLMenu"]],
     LineSpacing->{1.4, 0}]], "AnchorBar"]}
  }]], "AnchorBarGrid",
 GridBoxOptions->{GridBoxItemSize->{"Columns" -> {
     Scaled[0.65], {
      Scaled[0.34]}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, 
   "RowsIndexed" -> {}}},
 CellID->1],

Cell[TextData[{
 Cell["CheckDB", "ObjectName"],
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{8, 0}],
    CacheGraphics->False],
   Spacer[8]]]],
 Cell[BoxData[""], "ObjectNameTranslation"]
}], "ObjectNameGrid"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{"CheckDB", "[", 
       RowBox[{"exp", ",", " ", "fil"}], "]"}]], "InlineFormula"],
     " \[LineSeparator]saves [with Put] or retrieves [with Get] exp from a \
file fil. It checks if the setting of the option Directory is a valid \
directory name and if fil is a valid file name and does exist. If it does, \
Get[fil] is executed. If fil does not exist, exp gets evaluated and saved to  \
fil. Saving and evaluating can be further controlled with the options \
ForceSave and NoSave. If the option Check is set to False  the return value \
is what is evaluated [see above]. If Check is set to True the return value is \
True or False depending on whether the evaluation of exp agrees with what is \
loaded from fil or fil does not exist.  Default value of Check : False."
    }]]}
  }]], "Usage",
 GridBoxOptions->{
 GridBoxBackground->{
  "Columns" -> {{None}}, "ColumnsIndexed" -> {}, "Rows" -> {{None}}, 
   "RowsIndexed" -> {}}},
 CellID->982511436],

Cell[CellGroupData[{

Cell[TextData[Cell[BoxData[
 ButtonBox[Cell[TextData[{
   Cell[BoxData[
    InterpretationBox[
     StyleBox[
      GraphicsBox[{},
       BaselinePosition->Baseline,
       ImageSize->{6, 0}],
      CacheGraphics->False],
     Spacer[6]]]],
   "Details"
  }], "NotesFrameText"],
  Appearance->{Automatic, None},
  BaseStyle->None,
  ButtonFunction:>(FrontEndExecute[{
     FrontEnd`SelectionMove[
      FrontEnd`SelectedNotebook[], All, ButtonCell], 
     FrontEndToken["OpenCloseGroup"], 
     FrontEnd`SelectionMove[
      FrontEnd`SelectedNotebook[], After, CellContents]}]& ),
  Evaluator->None,
  Method->"Preemptive"]]]], "NotesSection",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->1807786562],

Cell["", "SectionHeaderSpacer"],

Cell["\<\
If fil ends with \".Gen\" or \".Mod\", the   setting of Directory is ignored \
and fil is  saved in the \"CouplingVectors\"  subdirectory of \"Phi\". If fil \
ends with  \".Fac\", the setting of Directory is  ignored and fil is saved in \
the \"Factors\" subdirectory of \"Phi\". If fil is a file   name with full \
path, the setting of  Directory is also ignored.\
\>", "Notes",
 CellID->1067943069],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Options", "[", "CheckDB", "]"}]], "Input",
 CellLabel->"In[305]:="],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{
    RowBox[{"Directory", "\[RuleDelayed]", 
     RowBox[{"ToFileName", "[", 
      RowBox[{
       RowBox[{"{", "$FeynCalcDirectory", "}"}], ",", "\<\"Database\"\>"}], 
      "]"}]}], ",", 
    RowBox[{"ForceSave", "\[Rule]", "False"}], ",", 
    RowBox[{"NoSave", "\[Rule]", "False"}], ",", 
    RowBox[{"Check", "\[Rule]", "False"}]}], "}"}], 
  TraditionalForm]], "Output",
 ImageSize->{355, 35},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[305]="]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Attributes", "[", "CheckDB", "]"}]], "Input",
 CellLabel->"In[306]:="],

Cell[BoxData[
 FormBox[
  RowBox[{"{", "HoldFirst", "}"}], TraditionalForm]], "Output",
 ImageSize->{70, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellLabel->"Out[306]="]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  InterpretationBox[
   StyleBox[
    GraphicsBox[{},
     BaselinePosition->Baseline,
     ImageSize->{6, 0}],
    CacheGraphics->False],
   Spacer[6]]]],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CellTags->"PrimaryExamplesSection",
 CellID->1152076630],

Cell[CellGroupData[{

Cell[TextData[{
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CellID->644169140],

Cell["\<\
The first time the Table function is evaluated and the result saved into the \
test.s file.\
\>", "Notes"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CheckDB", "[", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"WriteString", "[", 
       RowBox[{"\"\<stdout\>\"", ",", "\"\<test \>\""}], "]"}], ";", "i"}], 
     ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "2"}], "}"}]}], "]"}], ",", "\"\<test.s\>\""}], 
  "]"}]], "Input",
 CellTags->"CheckDB",
 CellLabel->"In[1]:=",
 CellID->1433287094],

Cell["test test ", "Print",
 CellTags->"CheckDB",
 CellLabel->"During evaluation of In[307]:="],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{"1", ",", "2"}], "}"}], TraditionalForm]], "Output",
 ImageSize->{41, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CheckDB",
 CellLabel->"Out[1]="]
}, Open  ]],

Cell["\<\
Executing the same a second time will just load the result from test.s and \
not evaluate the Table function.\
\>", "Notes"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"CheckDB", "[", 
  RowBox[{
   RowBox[{"Table", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"WriteString", "[", 
       RowBox[{"\"\<stdout\>\"", ",", "\"\<test \>\""}], "]"}], ";", "i"}], 
     ",", 
     RowBox[{"{", 
      RowBox[{"i", ",", "2"}], "}"}]}], "]"}], ",", "\"\<test.s\>\""}], 
  "]"}]], "Input",
 CellTags->"CheckDB",
 CellLabel->"In[2]:=",
 CellID->1024102984],

Cell[BoxData[
 FormBox[
  RowBox[{"{", 
   RowBox[{"1", ",", "2"}], "}"}], TraditionalForm]], "Output",
 ImageSize->{41, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CheckDB",
 CellLabel->"Out[2]="]
}, Open  ]],

Cell["This shows the actual saved value of test.s.", "Notes"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Import", "[", 
  RowBox[{
   RowBox[{"ToFileName", "[", 
    RowBox[{
     RowBox[{"Directory", "/.", 
      RowBox[{"Options", "[", "CheckDB", "]"}]}], ",", "\"\<test.s\>\""}], 
    "]"}], ",", "\"\<Text\>\""}], "]"}]], "Input",
 CellTags->"CheckDB",
 CellLabel->"In[3]:=",
 CellID->1578936180],

Cell[BoxData[
 FormBox["\<\"{1, 2}\"\>", TraditionalForm]], "Output",
 ImageSize->{41, 16},
 ImageMargins->{{0, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}},
 CellTags->"CheckDB",
 CellLabel->"Out[3]="]
}, Open  ]],

Cell[BoxData[
 RowBox[{"DeleteFile", "[", 
  RowBox[{"ToFileName", "[", 
   RowBox[{
    RowBox[{"Directory", "/.", 
     RowBox[{"Options", "[", "CheckDB", "]"}]}], ",", "\"\<test.s\>\""}], 
   "]"}], "]"}]], "Input",
 CellTags->"CheckDB",
 CellLabel->"In[4]:=",
 CellID->1720430951]
}, Open  ]]
}, Open  ]],

Cell[" ", "FooterCell"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{725, 750},
WindowMargins->{{-10, Automatic}, {Automatic, -8}},
WindowTitle->"CheckDB",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "SymbolColor", "LinkTrails" -> 
  GridBox[{{
      RowBox[{
        ButtonBox[
        "FeynCalc", ButtonData -> "paclet:FeynCalc/guide/FeynCalc", 
         BaseStyle -> {"Link", "DockedLinkTrail"}]}]}}, ColumnAlignments -> 
    Left], "HasOptions" -> False, "ExampleCounter" -> 1, "NeedPlatMsgIn" -> 
  None, "RootCaptions" -> "", 
  "Metadata" -> {
   "built" -> "{2020, 6, 20, 19, 2, 55.244221}", 
    "history" -> {"9.0", "", "", ""}, "context" -> "FeynCalc`", 
    "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Feyn Calc Symbol", "language" -> "en", "paclet" -> "FeynCalc", "status" -> 
    "None", "summary" -> 
    "CheckDB[exp, fil] saves [with Put] or retrieves [with Get] exp from a \
file fil. It checks if the setting of the option Directory is a valid \
directory name and if fil is a valid file name and does exist. If it does, \
Get[fil] is executed. If fil does not exist, exp gets evaluated and saved to \
fil. Saving and evaluating can be further controlled with the options \
ForceSave and NoSave. If the option Check is set to False the return value is \
what is evaluated [see above]. If Check is set to True the return value is \
True or False depending on whether the evaluation of exp agrees with what is \
loaded from fil or fil does not exist. Default value of Check : False.", 
    "synonyms" -> {}, "tabletags" -> {}, "title" -> "CheckDB", 
    "titlemodifier" -> "", "windowtitle" -> "CheckDB", "type" -> "Symbol", 
    "uri" -> "FeynCalc/ref/CheckDB"}, "SearchTextTranslated" -> ""},
CellContext->"Global`",
FrontEndVersion->"10.4 for Linux x86 (64-bit) (April 11, 2016)",
StyleDefinitions->Notebook[{
   Cell[
    StyleData[
    StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb"]]], 
   Cell[
    StyleData["Input"], CellContext -> "Global`"], 
   Cell[
    StyleData["Output"], CellContext -> "Global`"]}, Visible -> False, 
  FrontEndVersion -> "10.4 for Linux x86 (64-bit) (April 11, 2016)", 
  StyleDefinitions -> "Default.nb"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "PrimaryExamplesSection"->{
  Cell[6457, 196, 388, 15, 31, "PrimaryExamplesSection",
   CellTags->"PrimaryExamplesSection",
   CellID->1152076630]},
 "CheckDB"->{
  Cell[7209, 230, 403, 14, 45, "Input",
   CellTags->"CheckDB",
   CellID->1433287094],
  Cell[7615, 246, 95, 2, 23, "Print",
   CellTags->"CheckDB"],
  Cell[7713, 250, 235, 8, 37, "Output",
   CellTags->"CheckDB"],
  Cell[8122, 268, 403, 14, 45, "Input",
   CellTags->"CheckDB",
   CellID->1024102984],
  Cell[8528, 284, 235, 8, 37, "Output",
   CellTags->"CheckDB"],
  Cell[8864, 299, 319, 10, 27, "Input",
   CellTags->"CheckDB",
   CellID->1578936180],
  Cell[9186, 311, 201, 6, 37, "Output",
   CellTags->"CheckDB"],
  Cell[9402, 320, 284, 9, 27, "Input",
   CellTags->"CheckDB",
   CellID->1720430951]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"PrimaryExamplesSection", 12134, 386},
 {"CheckDB", 12269, 390}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[579, 21, 2268, 53, 53, "AnchorBarGrid",
 CellID->1],
Cell[2850, 76, 284, 11, 45, "ObjectNameGrid"],
Cell[CellGroupData[{
Cell[3159, 91, 1033, 20, 170, "Usage",
 CellID->982511436],
Cell[CellGroupData[{
Cell[4217, 115, 739, 24, 31, "NotesSection",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->1807786562],
Cell[4959, 141, 31, 0, 14, "SectionHeaderSpacer"],
Cell[4993, 143, 410, 7, 83, "Notes",
 CellID->1067943069],
Cell[CellGroupData[{
Cell[5428, 154, 91, 2, 27, "Input"],
Cell[5522, 158, 541, 16, 56, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6100, 179, 94, 2, 27, "Input"],
Cell[6197, 183, 199, 6, 37, "Output"]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[6457, 196, 388, 15, 31, "PrimaryExamplesSection",
 CellTags->"PrimaryExamplesSection",
 CellID->1152076630],
Cell[CellGroupData[{
Cell[6870, 215, 195, 6, 26, "ExampleSection",
 CellID->644169140],
Cell[7068, 223, 116, 3, 32, "Notes"],
Cell[CellGroupData[{
Cell[7209, 230, 403, 14, 45, "Input",
 CellTags->"CheckDB",
 CellID->1433287094],
Cell[7615, 246, 95, 2, 23, "Print",
 CellTags->"CheckDB"],
Cell[7713, 250, 235, 8, 37, "Output",
 CellTags->"CheckDB"]
}, Open  ]],
Cell[7963, 261, 134, 3, 48, "Notes"],
Cell[CellGroupData[{
Cell[8122, 268, 403, 14, 45, "Input",
 CellTags->"CheckDB",
 CellID->1024102984],
Cell[8528, 284, 235, 8, 37, "Output",
 CellTags->"CheckDB"]
}, Open  ]],
Cell[8778, 295, 61, 0, 32, "Notes"],
Cell[CellGroupData[{
Cell[8864, 299, 319, 10, 27, "Input",
 CellTags->"CheckDB",
 CellID->1578936180],
Cell[9186, 311, 201, 6, 37, "Output",
 CellTags->"CheckDB"]
}, Open  ]],
Cell[9402, 320, 284, 9, 27, "Input",
 CellTags->"CheckDB",
 CellID->1720430951]
}, Open  ]]
}, Open  ]],
Cell[9713, 333, 23, 0, 41, "FooterCell"]
}
]
*)

(* End of internal cache information *)

